<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <meta charset="UTF-8">
    <title>客户贡献分析</title>


</head>
<body>
<div layout:fragment="content">
    <div id="rptDiv" style="width: 1000px;height:600px; top:100px"></div>
    <script th:src="@{../js/echarts.min.js}" src="../../static/js/echarts.min.js" ></script>

    <script type="text/javascript" th:inline="javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('rptDiv'));
        var custmoers=[[${custmoers}]]

        console.log(custmoers)

        var orderAmounts=[[${orderAmounts}]]
        console.log(orderAmounts)

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '客户贡献报表'
            },
            tooltip: {},
            legend: {
                data: ['订单金额']
            },
            xAxis: {
                data: custmoers
            },
            yAxis: {},
            series: [
                {
                    name: '订单金额',
                    type: 'line',
                    data: orderAmounts
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>

</div>

</body>
</html>